﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Abs.App.Admin
{
    public partial class Delete_Appointment : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Role"] == null)
            {
                Response.Redirect("~/User/Unauthorized_Access.aspx");
            }

            if (((int)Session["Role"] != (int)Abs.Core.Models.User.RoleEnum.Admin))
            {
                Response.Redirect("~/User/Unauthorized_Access.aspx");
            }

            var appManager = Abs.Core.Management.Manage.Appointment;
            appManager.DeleteAppointment(int.Parse(Request.QueryString["Id"]));
            Response.Redirect("~/Admin/Manage_Appointments.aspx");
        }
    }
}